#pragma once
#include <Windows.h>
#include <stdio.h>
#include <stdarg.h>
#include "Graphics.h"

class App
{
private:

protected:
	HINSTANCE hInst;
	HWND hWND;

	char className[MAX_PATH];
	char frameCaption[MAX_PATH];

	WNDCLASSEX wndClassEX;
	DWORD style;
	DWORD xPos, yPos;
	DWORD width, height;

	bool paused;

	Renderer::Graphics * gGraphics;

public:
	App(HINSTANCE hInst);
	virtual ~App(void);

	HWND GetHWND() { return hWND; }
	HINSTANCE GetHInstance() { return hInst; }

	bool Run();
	bool Error(BOOL Fatal, char * text, ...);

	bool Move(DWORD xPos, DWORD yPos);
	bool Resize(DWORD width, DWORD height);

	bool ShowMouse(bool show = true);

	virtual LRESULT WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);

	virtual int Init() { return true; }
	virtual int Shutdown() { return true; }
	virtual int Frame() { return true; }

	virtual void App::AppError(BOOL Fatal, char * text, ...);
	
};



